# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=cglm
pkgver=0.8.5
pkgrel=0
pkgdesc="Highly Optimized Graphics Math (glm) for C"
url="https://github.com/recp/cglm"
arch="all"
license="MIT"
makedepends="autoconf automake libtool py3-sphinx py3-sphinx_rtd_theme"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/recp/cglm/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	sh autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
	cd "docs"
	sphinx-build source build
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir/usr/share/doc/cglm"
	cp -a docs/build "$pkgdir/usr/share/doc/cglm"
}

sha512sums="
a8f6df415dc482a9b16bb7ff44aba77c32e7297b48d5e7b0fb5b2e0d92fc80cad8e436d0c83fdd7cc0836ba451137d72af2f0f823ce9698000bf257b3019b7c5  cglm-0.8.5.tar.gz
"
